package com.zxy.feiclients;

import com.zxy.feiclients.fallback.StorageFallback;
import com.zxy.result.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "storage-service-client",fallbackFactory = StorageFallback.class)
public interface StorageService {

    /**
     * 调用库存微服务做库存的扣减操作
     * @param productId 商品id
     * @param count 商品的数量
     */
    @PostMapping(value = "/storage/decrease")
    CommonResult decrease(@RequestParam("productId") Long productId,
                          @RequestParam("count") Integer count);
}
